package com.bitcoin.scheduler.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 价格详情
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Table(name = "bcc_price_info_detail",
    uniqueConstraints = {@UniqueConstraint(name = "bccPriceTime", columnNames = {"bccId", "priceTime"})}
)
@DynamicInsert
@DynamicUpdate
public class BccPriceInfoDetail extends Identity {
    private String bccId;
    //价格时间
    private Date priceTime;
    //价格美元
    private String priceUsd;
    //价格人民币
    private String priceCny;
    //价格比特币
    private String priceBtc;
    //记录创建时间
    private Date createTime;


    //MA 5日 10日 20日 30日 RMB均价
    @Column(name = "ma5_cny")
    private BigDecimal ma5Cny = BigDecimal.ZERO;
    @Column(name = "ma10_cny")
    private BigDecimal ma10Cny = BigDecimal.ZERO;
    @Column(name = "ma20_cny")
    private BigDecimal ma20Cny = BigDecimal.ZERO;
    @Column(name = "ma30_cny")
    private BigDecimal ma30Cny = BigDecimal.ZERO;

}
